<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
<%	
String userr="";
userr = (session.getAttribute("userr")==null) ? "Null" : (String)session.getAttribute("userr"); 

if(userr.equals("Null"))
{
	session.invalidate();
	%>
	<!--<H5 align=center><IMG SRC="Images/error.gif" WIDTH="17" HEIGHT="13" BORDER=0 ALT="">Session time out...Please login again</H5>-->
	<script language=javascript>
		location.replace('sessiontimeout.html');
	</script>
	<% 
}
else{
%>
<HTML>
    <HEAD>

    <script LANGUAGE="Javascript" SRC="Images/validate.js"></script>

    <LINK href="styles.css" type="text/css" rel="stylesheet">
    <script LANGUAGE="Javascript" SRC="Images/calender.js"></script>
    <script LANGUAGE="Javascript" >
		function ChkMandatoryField(F,T){
			var val= F.value;
			if(val==""){alert(T+" is mandatory");return false;}
		}
		function ChkNumField(F,T){
			var val = F.value;
			if(isNaN(val)==true||val==""){alert("Please enter numbers for "+T);return false;}
		}
		function ChkAlphaNumericField(F,T){
			var val = F.value;
			var pattern = /^([a-zA-Z0-9]{1,250})$/;
			if(!(pattern.test(val)==true)){alert("Please enter alphabets or numbers for "+T);return false;}
		}
		function ChkAlphaField(F,T){
			var val = F.value;
			var pattern = /^([a-zA-Z ]{1,250})$/;
			if(!(pattern.test(val)==true)){alert("Please enter text for "+T);return false;}
		}
		function ChkEmailField(F,T){
			var val = F.value;
			var pattern = /^[a-zA-Z0-9\_\.]+\@[a-zA-Z\.]+\.([a-z]{2,4})$/;			if(!(pattern.test(val)==true)){alert("Please enter valid email for "+T);return false;}
		}
		function ChkDateField(F,T)
		{
			var val = F.value;
		    var pattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
		    if(!(pattern.test(val)==true)){alert("Please enter valid date format (yyyy-mm-dd) for "+T);return false;}
		}
		function validateWWW(){
			var frm = document.forms(0);
			var website=frm.value;
 		    var pattern = /^www\.[a-zA-Z0-9 \-\.]+\.([a-zA-Z]{2,4})$/;
			 if(!(pattern.test(website))) 
			 {
				alert("Please enter valid website address");
				return false;
			 } else
			 return true;
		}
		function validate()
		{
			var frm = document.forms(0);
			if(ChkMandatoryField(frm.JobTitle,'JobTitle')==false) return false;
			if(ChkMandatoryField(frm.JobDescription,'JobDescription')==false) return false;
			if(ChkMandatoryField(frm.FunctionalArea,'FunctionalArea')==false) return false;	if(ChkMandatoryField(frm.Eligibility,'Eligibility')==false) return false;
			if(ChkMandatoryField(frm.Location,'Location')==false) return false;
			if(ChkAlphaField(frm.Location,'Location')==false) return false;
			if(ChkMandatoryField(frm.WalkinDate,'WalkinDate')==false) return false;
			if(ChkDateField(frm.WalkinDate,'WalkinDate')==false) return false;
			if(ChkMandatoryField(frm.WalkinTime,'WalkinTime')==false) return false;
			if(ChkMandatoryField(frm.CompanyName,'CompanyName')==false) return false;
			if(ChkMandatoryField(frm.CompanyDescription,'CompanyDescription')==false) return false;
			if(ChkMandatoryField(frm.Address,'Address')==false) return false;
			if(ChkMandatoryField(frm.Website,'Website')==false) return false;
			if(ChkMandatoryField(frm.EmailToRegister,'EmailToRegister')==false) return false;
			if(ChkEmailField(frm.EmailToRegister,'EmailToRegister')==false) return false;
		}
	</script>
	</HEAD>
	<Body class=Grad>
	<H2 align=center>Add New Walk-in</H2>
	<FORM ACTION="AddNewWalkin1.jsp" onsubmit="return validate()">
	<TABLE align=center width="50%">

		<TR>
				<TH align="left">JobTitle<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='JobTitle' value=''></TD>
		</TR>
		<TR>
				<TH align="left">JobDescription</TH>
				<TD><textarea name=JobDescription></textarea></TD>
		</TR>
	
		<TR>
			<TH align="left">FunctionalArea<FONT COLOR="red">*</FONT></TH>	
			<TD  class=row_even><select name="FunctionalArea">
			<option value="">Select</option>
			<option value="Accounts">Accounts,Finance</option>
			<option value="Banking">Banking,Insurance</option>
			<option value="HR">HR/Administration</option>
			<option value="BPO">ITES/BPO/IPO</option>
			<option value="Marketing">Marketing,Advertising</option>
			<option value="Production">Production,Maintainance</option>
			<option value="Telecom">Telecom</option>
			<option value="IT">Information Technology</option>
			<option value="Application">Application,Programming</option>
			<option value="DBA">DBA,Datawarehousing</option>
			<option value="Mainframe">Mainframe</option>
			<option value="Networking">Network administaration</option>
			<option value="Testing">QA&Testing</option>
			<option value="SystemProgramming">SystemProgramming</option>
			<option value="Medical">Medical/Healthcare</option>
			<option value="InteriorDesign">Architecture,InteriorDesign</option>
			<option value="Media">Media/Entertainment</option>
		</TR>
	    <TR>
				<TH align="left">Eligibility<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='Eligibility' value=''></TD>
		</TR>
		<TR>
				<TH align="left">Location<FONT COLOR="red">*</FONT></TH>
				<TD><select name=Location>
				<option value=Hyderabad>Hyderabad</option>
				<option value=Secundrabad>Secundrabad</option>
				<option value=Chennai>Chennai</option>
				<option value=Delhi>Delhi</option>
				<option value=Pune>Pune</option>
				<option value=Bangalore>Bangalore</option>
				<option value=Mysore>Mysore</option>
				<option value=Mumbai>Mumbai</option>
				</select></TD>
		</TR>
		<TR>
				<TH align="left">WalkinDate<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='WalkinDate' value='' readonly><img onkeypress="fnCalendar(this)" id="imgDate" style="CURSOR: hand" onClick="fnCalendar(this)" height="16" src="Images/CalDis.gif" width="16" border="0" name="imgDate" onMouseOver="fnEnableCalLookup(this)" onMouseOut="fnDisableCalLookup(this)" ></TD>
		</TR>
		<TR>
				<TH align="left">WalkinTime<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='WalkinTime' value=''></TD>
		</TR>
		<TR>
				<TH align="left">CompanyName<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='CompanyName' value=''></TD>
		</TR>
		<TR>
				<TH align="left">CompanyDescription<FONT COLOR="red">*</FONT></TH>
				<TD><textarea name=CompanyDescription></textarea></TD>
		</TR>
		<TR>
				<TH align="left">Address<FONT COLOR="red">*</FONT></TH>
				<TD><textarea name=Address></textarea></TD>
		</TR>
		<TR>
				<TH align="left">Website<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='Website' value=''></TD>
		</TR>
		<TR>
				<TH align="left">EmailToRegister<FONT COLOR="red">*</FONT></TH>
				<TD><Input type=text name='EmailToRegister' value=''></TD>
		</TR>
		<TR><TH><INPUT TYPE="submit" value='Add' class=Button></TH><TH><INPUT TYPE="reset" value='Clear' class=Button></TH></TR>
	</TABLE>
	<H6 align=center>Fields with <FONT SIZE="" COLOR="red">*</FONT> are mandatory </H6>
	</FORM>
	</BODY>
<%
}
%>
